﻿using Cofe.Core.Property;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;

namespace Cofe.Core.Security
{
    public interface IUserManager : ICofeService
    {
        IEnumerable<IPrincipalPolicy> GetPrincipalPolicies();
        IPrincipal GetPrincipal(IIdentity identity = null);        

        void AddPrincipalPolicy(IPrincipalPolicy policy);       
        void RemovePrincipalPolicy(Func<IPrincipalPolicy, bool> filter);
    }

    public interface IPrincipalPolicy 
    {
        bool Match(IIdentity identity);
        string[] GrantRole { get; }
    }

    
}
